package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.MaterialQualityMapper;
import com.ly.heart.domain.MaterialQualityEntity;
import javax.annotation.Resource;
import com.ly.heart.service.IMaterialQualityService;

/**
 * 物料质量信息Service业务层处理
 * 
 * @author wutao
 * @date 2024-07-04
 */
@Service
public class MaterialQualityServiceImpl extends ServiceImpl<MaterialQualityMapper, MaterialQualityEntity> implements IMaterialQualityService {

    @Resource
    private MaterialQualityMapper materialQualityMapper;

    /**
     * 查询物料质量信息
     * 
     * @param id 物料质量信息ID
     * @return 物料质量信息
     */
    @Override
    public MaterialQualityEntity selectMaterialQualityById(String id)
    {
        return materialQualityMapper.selectMaterialQualityById(id);
    }

    /**
     * 查询物料质量信息列表
     * 
     * @param materialQuality 物料质量信息
     * @return 物料质量信息
     */
    @Override
    public List<MaterialQualityEntity> selectMaterialQualityList(MaterialQualityEntity materialQuality)
    {
        return materialQualityMapper.selectMaterialQualityList(materialQuality);
    }

    /**
     * 新增物料质量信息
     * 
     * @param materialQuality 物料质量信息
     * @return 结果
     */
    @Override
    public int insertMaterialQuality(MaterialQualityEntity materialQuality)
    {
        materialQuality.setCreateTime(DateUtils.getNowDate());
        return materialQualityMapper.insertMaterialQuality(materialQuality);
    }

    /**
     * 修改物料质量信息
     * 
     * @param materialQuality 物料质量信息
     * @return 结果
     */
    @Override
    public int updateMaterialQuality(MaterialQualityEntity materialQuality)
    {
        materialQuality.setUpdateTime(DateUtils.getNowDate());
        return materialQualityMapper.updateMaterialQuality(materialQuality);
    }

    /**
     * 批量删除物料质量信息
     * 
     * @param ids 需要删除的物料质量信息ID
     * @return 结果
     */
    @Override
    public int deleteMaterialQualityByIds(String[] ids)
    {
        return materialQualityMapper.deleteMaterialQualityByIds(ids);
    }

    /**
     * 删除物料质量信息信息
     * 
     * @param id 物料质量信息ID
     * @return 结果
     */
    @Override
    public int deleteMaterialQualityById(String id)
    {
        return materialQualityMapper.deleteMaterialQualityById(id);
    }
}
